/* MAIN Picaroon Go file 

   Picaroon is a Roguelike Written in Google Go.
   We have a simple gameloop which iterates through a priority queue of entities giving the active one an action
	The Player entity performs actions via a PollInput() command issued against the active console for input
	Every time an action is performed (player or otherwise) we update all attached consoles with changes to the display (and other world state)

	command stuff is in command.go
	console (I/O) stuff is in console.go (and the specialised *console.go for each type of console)
	player definitions are in player.go, but derive as special cases of creature.go

*/


func main() {
	//main loop
	
	maps = new Atlas
	db = make(DisplayBuffer)
	cc = make(SDLConsole).(Grconsole_rw)
	//or do we have a "Atlas" interface that wraps a []Map object, and owns the DisplayBufferCtrl?
	//that way, we don't have to keep giving the DisplayBuffer to a map every time we move level
	maps.Init(db.(DisplayBufferCtrl), number-of-maps ...) //the Atlas init keeps a copy of the DisplayBufferCtrl, and uses it to hand the right MapView to the DB.
	cc.Init(....)
	
	for (player != dead){
		get next action //creature and player actions are dealt with in this loop
			if (changes map) {
				maps(change map) //move to map at new level, update DisplayBuffer MapView, and trigger a Refresh of DB (which also sets all cells dirty)
			}
		cc.Refresh(....) //update the display (the display has the right to update itself asynchronously with this to maintain UI, but this call pushes new data
				// from the model to the view it represents).
	}
	print "You are Dead"
	print "DYWYPI?"

}
